package com.zhuozhengsoft.springbootpageoffice.controller;


import com.zhuozhengsoft.pageoffice.FileSaver;
import com.zhuozhengsoft.pageoffice.OpenModeType;
import com.zhuozhengsoft.pageoffice.PageOfficeCtrl;
import com.zhuozhengsoft.springbootpageoffice.util.GetDirPathUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

@RestController
@RequestMapping(value = "/HtmlDialog")
public class HtmlDialogController {

    @RequestMapping(value = "/Word")
    public ModelAndView showWord(HttpServletRequest request, Map<String, Object> map) {
        PageOfficeCtrl poCtrl = new PageOfficeCtrl(request);
        //打开Word文档
        poCtrl.webOpen("/doc/HtmlDialog/test.doc", OpenModeType.docNormalEdit, "张佚名");
        map.put("pageoffice", poCtrl.getHtmlCode());
        ModelAndView mv = new ModelAndView("HtmlDialog/Word");
        return mv;
    }

    @RequestMapping(value = "/Modal")
    public ModelAndView Modal(HttpServletRequest request) {

        ModelAndView mv = new ModelAndView("HtmlDialog/Modal");
        return mv;
    }

    @RequestMapping(value = "/Modeless")
    public ModelAndView Modeless(HttpServletRequest request) {

        ModelAndView mv = new ModelAndView("HtmlDialog/Modeless");
        return mv;
    }


}
